<?php session_start(); ?> 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
<link rel="stylesheet" href="../css/ABC.css" type="text/css"/>
<script type="text/javascript" src="../js/form.js"></script>
</head>
</html>

<?php

include("../classes/ConnectionBDD.php");
include("../classes/Formulaires.php");
include("../classes/Intervenants.php");
include("../classes/FormulairesI.php");

$bdd = new Connector_Sql();
$frm = new Formulaires();
$frmI = new FormulairesI();
$inan = new Intervenants();

mysql_connect('localhost','root','') or die('Connexion impossible a la BDD');
mysql_select_db('ABC PRO');

$frmI->debutFormulaire('Modifier intervenant','modif','modifierIntervenant.php');
$frm->ligne_vide();
$inan->listerIntervenant('liste_i');
$frmI->pwdbox('Nouveau mot de passe:','mdp_m');
$frm->ligne_vide();
$frm->fin_formulaire();

//modifie un intervenant en avertissant l'utilisateur avec un message popup
if (isset($_POST['liste_i']) and isset($_POST['mdp_m'])) {

	$pwd = md5($_POST['mdp_m']);
	
	if($inan->modifierIntervenant($_POST['liste_i'],$pwd,$_SESSION['log'])) {
		echo "<script type='text/javascript'>alert(\"Intervenant ".$_POST['liste_i']." modifie\");</script>";
	}

}

$bdd->deconnect();

?>
